package com.imjohn.service;

import com.imjohn.entity.Top_mid;
import com.imjohn.mapper.TopmidMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;


@Service
public class TopmidService {
    @Autowired
    TopmidMapper topmidMapper;
    /**
     *  是否点过赞
     * */
    public List<HashMap> isGoodFlag (String userId, String aticleId) {
        return topmidMapper.isGoodFlag(userId, aticleId);
    }
    /**
     * 插入点赞表
     * */
    public int setGoodFlag (String userId, String aticleId, String goodFlag) {
        // 点赞
        return topmidMapper.setGoodFlag(userId, aticleId, goodFlag);
    }
    /**
    * 取消点赞
    * */
    public int cancelGoodFlag ( Top_mid top_mid ) {
        return topmidMapper.cancelGoodFlag(top_mid);
    }
}
